﻿using System;
using wojilu.ORM;

namespace wojilu.Apps.Qycms.Domain
{
    [Table("ybb_document_label")]
    [Serializable]
    public class Document_Label : ObjectBase<Document_Label>
    {
        public Document_Label() { }

        public Document_Label(String lng, Int32 mid, String labelname)
        {
            this.lng = lng;
            this.mid = mid;
            this.labelname = labelname;
            this.insert();
        }

        [NotNull(""), Column(Length = 50)]
        public String lng { get; set; }

        [Column(Length = 11), NotNull(""), Default(0)]
        public Int32 mid { get; set; }

        [NotNull(""), Column(Length = 100)]
        public String labelname { get; set; }

        [NotSave]
        public String modelname
        {
            get
            {
                var dl = Model.find(" Id = :m").set("m", mid).first();
                return dl != null ? dl.modelname : String.Empty;
            }
        }
    }

}
